'''管理token'''
import requests

from api.base import BaseApi
from libs.parser import parser_files, write_files
from pathlib import Path

class Login(BaseApi):
    def __init__(self):
        '''host和token'''
        env_path = Path().cwd() / 'env'
        self._env_data = parser_files(str(env_path / 'test.yaml'))
        self._token_data = parser_files(str(env_path / 'token.yaml'))

        # '''平台相关数据'''
        self.PLA_BASE_URL = self._env_data['platform']['host']

        # '''用户相关数据'''
        self.USER_BASE_URL = self._env_data['user']['host']

        # '''商户相关数据'''
        self.MER_BASE_URL = self._env_data['merchant']['host']

        self.platform_token = self._token_data['platform_token']
        self.merchant_token = self._token_data['merchant_token']
        self.user_token = self._token_data['user_token']

